package com.fesine.ch02.t9;

/**
 * @description: 类描述
 * @author: Fesine
 * @createTime:2016/7/5 9:19
 * @update:修改内容
 * @author: Fesine
 * @updateTime:2016/7/5 9:19
 */
public class MyService {
    public MyOneList addServiceMethod(MyOneList list, String data) {
        try {
            synchronized (list) {
                if (list.getSize() < 1) {
                    Thread.sleep(2000);
                    list.add(data);
                }
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return list;
    }
}
